import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/jstGoods/addOrSave',
    method: 'post',
    data
  })
}
export function jstGoods(data) {
  return request({
    url: '/api/jstGoods',
    method: 'get',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/jstGoods',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/jstGoods/addOrSave',
    method: 'post',
    data
  })
}

export function copy(data) {
    return request({
        url: 'api/jstGoods/copy',
        method: 'post',
        data
    })
}

export function exportDe(data) {
    return request({
        url: 'api/jstGoods/export',
        method: 'post',
        data
    })
}

export function importDe(data) {
    return request({
        url: 'api/jstGoods/import',
        method: 'post',
        data
    })
}


export function enableOrDisable(data) {
    const obj = {
        url: 'api/jstGoods/enableOrDisable',
        method: 'post',
        data
    }
    return request(obj)
}
// 查看上新情况 
export function queryGroundNew(data) {
    const obj = {
        url: 'api/jstGoods/queryGroundNew',
        method: 'get',
        data
    }
    return request(obj)
}
// 查看上新情况 
export function groundNew(data) {
    const obj = {
        url: 'api/jstGoods/groundNew',
        method: 'post',
        data
    }
    return request(obj)
}
// 查看商品库存 
export function queryInventory(data) {
    const obj = {
        url: 'api/jstGoods/queryInventory',
        method: 'get',
        data
    }
    return request(obj)
}

export default { add, edit, copy,exportDe, importDe, del, enableOrDisable ,queryGroundNew ,queryInventory,jstGoods,groundNew}
